<%-- 
    Document   : view_updated_profile
    Created on : Sept 13, 2012, 2:09:37 PM
    Author     : Faizal
--%>
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Kemaskini Profil</title>
        <script type="text/javascript">
            $(document).ready(function(){
//                $('form').submit( function () {
//                    return formValidation();
//                }); 

            if(typeof String.prototype.trim !== 'function') {
                    String.prototype.trim = function() {
                      return this.replace(/^\s+|\s+$/g, ''); 
                    }
                  }
                  
            });
             function popupWin(){
                var url = '${pageContext.request.contextPath}/tac?generateProfileUpdateTac';
                popupWindow = window.open(
                url,'popUpWindow',
                'height=450,width=630,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
            }
                        
           
            function validate(f)
            {
                if(document.getElementById("tac").value.trim().length<1)
                    {
                        alert("Sila Masukkan nombor TAC")
                        return false;
                    }
                else if(document.getElementById("tac").value.length<6)
                    {
                        alert("No TAC mesti mengandungi 6 aksara");
                        return false;
                    }
                else 
                    {
                        blockUI();
                        f.action="${pageContext.request.contextPath}/deposit?saveUpdateProfile";
                        f.submit();
                    }                    
            }
            
            function redirectToHomePage(f){
                var url = '${pageContext.request.contextPath}/deposit?showMainForm';
                f.action = url;
                f.submit();
            }
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/> 
        <br/>
        <s:form beanclass="th.stripes.action.DepositActionBean" class="niceform">
            <s:hidden name="deposit.noAkaun" id="noAkaun"></s:hidden> 
            <s:hidden name="deposit.noKp" id="noKp"></s:hidden> 
            <s:hidden name="deposit.nama" id="nama"></s:hidden>
            <s:hidden name="deposit.jantina.nama" id="jantina"></s:hidden>
            <s:hidden name="deposit.jantina.kod" id="jantina"></s:hidden>
            <s:hidden name="deposit.tarikhLahir" id="tarikLahir"></s:hidden>
            <s:hidden name="deposit.warganegara.nama" id="warganegara_nama"></s:hidden>
            <s:hidden name="deposit.warganegara.kod" id="warganegara"></s:hidden>
            <s:hidden name="deposit.nama" id="nama"></s:hidden>
            <s:hidden name="deposit.alamat1" id="alamat1"></s:hidden>
            <s:hidden name="deposit.alamat2" id="alamat2"></s:hidden>
            <s:hidden name="deposit.alamat3" id="alamat3"></s:hidden>
            <s:hidden name="deposit.alamat4" id="alamat4"></s:hidden>
            <s:hidden name="deposit.negeri.code" id="negeri"></s:hidden>
            <s:hidden name="deposit.negeri.desc" id="negeri.desc"></s:hidden>
            <s:hidden name="deposit.poskod" id="poskod"></s:hidden>
            <s:hidden name="deposit.noTel1" id="noTel1"></s:hidden>
            <s:hidden name="deposit.noTel2" id="noTel2"></s:hidden>
            <s:hidden name="deposit.noTel3" id="noTel3"></s:hidden>
            <s:hidden name="deposit.email" id="email"></s:hidden>
            <s:hidden name="deposit.namaDatuk" id="namaDatuk"></s:hidden>
            <s:hidden name="deposit.sektorPekerjaan.kod" id="pekerjaan"></s:hidden>
            <s:hidden name="deposit.sektorPekerjaan.nama" id="pekerjaan.nama"></s:hidden>
            <s:hidden name="deposit.kahwin.nama" id="kahwin.nama"></s:hidden>
            <s:hidden name="deposit.kahwin.kod" id="kahwin.kod"></s:hidden>
            <s:hidden name="deposit.bangsa" id="bangsa"></s:hidden>
            <div id="content">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>
                    Kemaskini Profil
                </h3>  

                <p>
                    <label>No. Akaun TH :</label>
                    ${actionBean.deposit.noAkaun}&nbsp;
                </p>
                <p>
                    <label>No. KP Semasa :</label>
                    ${actionBean.deposit.noKp}&nbsp;
                </p>
                <p>
                    <label>Nama :</label>
                    ${actionBean.deposit.nama}&nbsp;
                </p>
                <p>
                    <label>Jantina :</label>
                    ${actionBean.deposit.jantina.nama}&nbsp;
                </p>
                <p>
                    <label>Kewarganegaraan :</label>
                    ${actionBean.deposit.warganegara.nama}&nbsp;
                </p>
                <p>
                    <label>Tarikh Lahir :</label>
                        <fmt:formatDate value="${actionBean.deposit.tarikhLahir}" pattern="dd/MM/yyyy" />&nbsp;
                </p>
                <p>
                    <label>Status Perkahwinan :</label>
                        ${actionBean.deposit.kahwin.nama}&nbsp;
                </p>
                 <p  style="height: 15px;">
                    <label>Alamat :</label>${actionBean.deposit.alamat1}&nbsp;        
                </p>
                <p style="height: 15px;">
                    <label>&nbsp; </label>${actionBean.deposit.alamat2}&nbsp;         
                </p>
                <p style="height: 15px;">
                    <label>&nbsp; </label>${actionBean.deposit.alamat3}&nbsp;         
                </p>
                <p style="height: 15px;">
                    <label>&nbsp; </label>${actionBean.deposit.poskod}&nbsp;${actionBean.deposit.alamat4}&nbsp;
                </p> 
                <p>
                    <label>Negeri :</label>
                        ${actionBean.deposit.negeri.desc}&nbsp;
                </p>
                <p>
                    <label>Poskod :</label>
                        ${actionBean.deposit.poskod}&nbsp;
                </p>
                <p>
                    <label>No Telefon&nbsp;&nbsp;</label><br>                        
                </p>
                <p style="height: 15px;">
                    <label>Rumah :</label>
                        ${actionBean.deposit.noTel1}&nbsp;
                </p>
                <p style="height: 15px;">
                    <label>Pejabat :</label>
                        ${actionBean.deposit.noTel2}&nbsp;
                </p>
                <p style="height: 15px;">
                    <label>Bimbit :</label>
                        ${actionBean.deposit.noTel3}&nbsp;
                </p> 
                <br>
                <p>
                    <label>Emel :</label>
                        ${actionBean.deposit.email}&nbsp;
                </p>
                <p>
                    <label>Nama Ibu :</label>
                        ${actionBean.deposit.namaDatuk}&nbsp;
                </p>
                <p>
                    <label>Sektor Pekerjaan :</label>
                    ${actionBean.deposit.sektorPekerjaan.nama}&nbsp;                   
                </p>
                <p>
                    <label>Kod Pengesahan Transaksi :</label>
                        <s:password name="deposit.tacNumber" id="tac" class="required" size="6" maxlength="6"/>&nbsp;
                </p>
                <br>
                <p>
                    Transaksi ini memerlukan Kod Pengesahan Transaksi(TAC). 
                    Sila klik <a href="JavaScript:popupWin()">
                        Kod Pengesahan Transaksi(TAC)</a>untuk mendapatkan kod tersebut.
                </p>
                <br/>
                <p align="center">                   
                    Profil akan dikemaskini, setuju?
                    <s:button name="saveUpdateProfile" value="Setuju" class="button green" onclick="validate(this.form)"/>
                    <s:submit name="showMainForm" value="Laman Utama" class="button green" onclick="redirectToHomePage(this.form)"/>
                </p>
            </div>
        </s:form>
    </body>
</html>
